Skip to content

Allow setting can_request_admin dynamically by claims of upstream IDP #4802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fl0lli
Copy link

@fl0lli fl0lli commented Jul 18, 2025

The option of only setting Synapse admin users statically via the local password database or the configuration file is restrictive.
When using an upstream IDP with a dynamic set of admin users, I would like to enable dynamic setting of the can_request_admin attribute.

As part of the OAuth2 callback, the claims of the upstream IDP are evaluated and imported.
IDPs can usually be configured so that they dynamically add claims to the token/UserInfo based on groups or similar.
For example, an upstream IDP can set the Boolean claim is_admin based on a group membership so that it can be imported like other claims using

admin:
 action: force
 template: "{{ user.is_admin }}"

The can_request_admin flag can then be set accordingly in the UserRepository.

This closes #4785.

fl0lli added 4 commits July 18, 2025 19:53
Signed-off-by: fl0lli <github@fl0lli.de>
…n feature of callback handler

Signed-off-by: fl0lli <github@fl0lli.de>
Signed-off-by: fl0lli <github@fl0lli.de>
@CLAassistant
Copy link

CLAassistant commented Jul 18, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting can_request_admin dynamically by upstream IDP
2 participants